From 67cc36df17957da97c6962845283f411a970b6e5 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Fri, 27 Apr 2007 15:22:34 +0100 Subject: [PATCH] xend: Auto-balloon a couple megabytes before creating an HVM domain as Xen will allocate 1MB for shadow memory immediately. Suggested by Daniel Berrange. Signed-off-by: Keir Fraser --- tools/python/xen/xend/XendDomainInfo.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index ecca07a355..4dc288314c 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -1419,6 +1419,9 @@ class XendDomainInfo: raise VmError("HVM guest support is unavailable: is VT/AMD-V " "supported by your CPU and enabled in your " "BIOS?") + # Hack to pre-reserve some memory for HVM setup. + # Needed because Xen allocates 1MB by default immediately. + balloon.free(2*1024) # 2MB should be plenty self.domid = xc.domain_create( domid = 0, -- 2.30.2